﻿using MyCompany.MyProject.Model.Models.RootKey;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCompany.MyProject.Model.Models
{
    /// <summary>
    /// 按钮根权限关联表
    /// </summary>
    public class RoleModulePermission:RootEntityTKey<long>
    {
        public long RoleId { get; set; }

        /// <summary>
        /// 接口ID
        /// </summary>
        public long ModuleId { get; set; }

        /// <summary>
        /// 前端菜单 ID
        /// </summary>
        public long? PermissionId { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDeleted { get; set; }

        /// <summary>
        /// 创建ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public long? CreateId { get; set; }
        /// <summary>
        /// 创建者
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string? CreateBy { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 修改ID
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public long? ModifyId { get; set; }
        /// <summary>
        /// 修改者
        /// </summary>
        [SugarColumn(Length = 50, IsNullable = true)]
        public string? ModifyBy { get; set; }
        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ModifyTime { get; set; } = DateTime.Now;

        // 下面2个实体参数，只做传参使用，所以忽略
        [SugarColumn(IsIgnore = true)]
        public Role? Role { get; set; }

        [SugarColumn(IsIgnore =true)]
        public Modules? Modules { get; set; }
    }
}
